import $http from '@/utils/request'
let request = ''
if (process.env.NODE_ENV !== 'production') {
  request = $http.sys1
} else {
  request = $http
}
// 角色列表
export function queryRolesList(params) {
  return request({
    url: '/api/roles',
    method: 'get',
    params
  })
}

// 添加角色
export function addRoles(params) {
  return request({
    url: '/api/roles',
    method: 'post',
    data: params
  })
}

// 修改角色
export function editRoles(params) {
  return request({
    url: '/api/roles',
    method: 'put',
    data: params
  })
}

// 删除角色
export function delRoles(ids) {
  return request({
    url: `/api/roles`,
    method: 'delete',
    data: ids
  })
}

// 查询权限级别
export function queryRolesLevel(params) {
  return request({
    url: '/api/roles/level',
    method: 'get',
    params
  })
}
